<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h2>图书列表</h2>
    <button onclick="window.location='/book/toAdd'">添加</button>
    <ul>
        <% books.forEach(book=>{
            %>
        <li><%=book._id%>---<%=book.name%>---<%=book.author%>---<%=book.price%>
            <button onclick="window.location='/book/toUpdate/<%=book._id%>'">修改</button>
            <button onclick="window.location='/book/remove/<%=book._id%>'">删除</button>
        </li>

        <%
        }) %>
    </ul>
</body>

</html>